﻿<local:MyPage 
    x:Class="ConstellationShow.Pages.Core"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:ConstellationShow"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    <local:MyPage.Resources>
        <DataTemplate x:Key="DataTemplate1">
            <controls:Pivot ItemsSource="{Binding Items}" >
                <controls:Pivot.HeaderTemplate>
                    <DataTemplate>
                        <Grid  Width="200" Height="100">
                            <TextBlock Margin="0" Text="{Binding Title}" />
                        </Grid>
                    </DataTemplate>
                </controls:Pivot.HeaderTemplate>
            </controls:Pivot>
        </DataTemplate>
        <Style x:Key="ButtonStyle1" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Canvas x:Name="canvas" Margin="0,0,0,1" Background="#FFDDD2F7">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FFBBA1F9" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="canvas" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="White" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FFBBA1F9" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="canvas" d:IsOptimized="True"/>
                                            <ColorAnimation Duration="0" To="White" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <TextBlock x:Name="textBlock" Canvas.Left="18" TextWrapping="Wrap" Canvas.Top="3" Foreground="#FF564E87" Height="25" FontSize="24" Width="108" Text="{TemplateBinding Content}"/>
                            <Image Height="21" Canvas.Left="422" Canvas.Top="10" Width="17" Source="/Images/arrow.png"/>
                        </Canvas>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyle2" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid x:Name="grid" Background="#FFCF74F1" HorizontalAlignment="Center" Width="177" Height="36" VerticalAlignment="Top">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FFDCB9E9" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" To="#FFDCB9E9" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <TextBlock FontSize="18.667" Margin="35,8,36,0" Height="27" VerticalAlignment="Top" Text="{TemplateBinding Content}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyle3" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Canvas Background="#FFC79FF0">
                            <Image Height="114" Width="137" Source="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Canvas.Left="8" Canvas.Top="9"/>
                            <TextBlock Canvas.Left="86" TextWrapping="Wrap" Canvas.Top="128" Height="20" Width="70" Foreground="White" FontSize="20" Text="{TemplateBinding Content}"/>
                        </Canvas>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <toolkit:WrapPanel ItemHeight="173" ItemWidth="140"/>
        </ItemsPanelTemplate>
        <DataTemplate x:Key="DataTemplate2">
            <Grid Height="133" Width="100" Tag="{Binding Id}" Margin="20" Background="#FFBEADEA">
                <Image Source="{Binding Image}" Stretch="Fill"/>
                <Canvas Height="26" VerticalAlignment="Bottom" Background="#7F000000">
                    <TextBlock x:Name="textBlock" Canvas.Left="8" TextWrapping="Wrap" 
					Text="{Binding Name}" Width="84" Foreground="White" Height="21"
					 FontSize="16" Canvas.Top="4" TextAlignment="Center"/>
                </Canvas>
            </Grid>
        </DataTemplate>
    </local:MyPage.Resources>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="Fill" ImageSource="/Images/blackground.jpg"/>
        </Grid.Background>
        <!--枢轴控件-->
        <controls:Pivot Name="piv"  SelectionChanged="Pivot_SelectionChanged">

            <controls:Pivot.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding}"  Foreground="#FF6624C1" FontSize="46.667"/>
                </DataTemplate>
            </controls:Pivot.HeaderTemplate>

            <!--枢轴项一-->
            <controls:PivotItem Header="运程">
                <Canvas Margin="0,-22,0,0" Height="689" VerticalAlignment="Top">
                    <Canvas Height="30" Width="110">
                        <Canvas Height="27" Width="27" Canvas.Left="10" Canvas.Top="2" Background="#FF7F49D1">
                            <Image x:Name="TitleIcon" Height="27" Width="27" Source="/Images/icon2_05.png"/>
                        </Canvas>
                        <TextBlock Canvas.Left="42" TextWrapping="Wrap" Name="TitleName" Text="" Canvas.Top="5" Foreground="#FF1D1D1D" FontSize="20"/>
                    </Canvas>
                    <ScrollViewer x:Name="s1" Canvas.Top="52" Width="456" Height="637">
                        <Grid Width="456" Margin="0" Height="850">
                            <Canvas Margin="0,0,0,272">
                                <Button Content="今日运程" Click="BtnLuck" Height="40" Style="{StaticResource ButtonStyle1}" Width="456"/>
                                <Canvas Height="377" Canvas.Top="42" Width="456">
                                    <Canvas Height="148" Canvas.Left="8" Width="193">
                                        <local:Star x:Name="_s1" mark="5" Canvas.Left="68" Canvas.Top="9" d:LayoutOverrides="Width, Height, Margin" />
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="整体：" Canvas.Top="8" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="爱情：" Canvas.Top="43" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="事业：" Canvas.Top="78" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="财富：" Canvas.Top="112" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <local:Star x:Name="s2" mark="5" Canvas.Left="68" Canvas.Top="45" d:LayoutOverrides="Width, Height, Margin" />
                                        <local:Star x:Name="s3" mark="4" Canvas.Left="68" Canvas.Top="80" d:LayoutOverrides="Width, Height, Margin" />
                                        <local:Star x:Name="s4" mark="2" Canvas.Left="68" Canvas.Top="112" d:LayoutOverrides="Width, Height, Margin" />
                                    </Canvas>
                                    <TextBlock TextWrapping="Wrap" Text="今日运势短评：" Canvas.Left="16" Canvas.Top="152" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock TextWrapping="Wrap" Text="贵人星座：" Canvas.Left="16" Canvas.Top="185" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock TextWrapping="Wrap" Text="幸运数字：" Canvas.Left="16" Canvas.Top="221" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock TextWrapping="Wrap" Text="吉时吉色：" Canvas.Left="16" Canvas.Top="257" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock TextWrapping="Wrap" Text="开运方位：" Canvas.Left="16" Canvas.Top="312" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock x:Name="txt1" TextWrapping="Wrap" Canvas.Left="150" Canvas.Top="152" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock x:Name="txt2" TextWrapping="Wrap" Canvas.Left="112" Canvas.Top="185" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock x:Name="txt3" TextWrapping="Wrap" Canvas.Left="112" Canvas.Top="221" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock x:Name="txt4" TextWrapping="Wrap" Canvas.Left="112" Canvas.Top="257" Foreground="#FF1D1D1D" FontSize="18"/>
                                    <TextBlock x:Name="txt5" TextWrapping="Wrap" Canvas.Left="112" Canvas.Top="312" Foreground="#FF1D1D1D" FontSize="18"/>
                                </Canvas>
                            </Canvas>
                            <Canvas Margin="0,405,0,400">
                                <Button Content="明日运程" Click="BtnLuck"  Height="40" Style="{StaticResource ButtonStyle1}" Width="456"/>
                                <Canvas Height="139" Canvas.Top="42" Width="456">
                                    <Canvas Height="148" Canvas.Left="8" Width="193">
                                        <local:Star x:Name="s2_1" mark="5" Canvas.Left="68" Canvas.Top="9" d:LayoutOverrides="Width, Height, Margin" />
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="整体：" Canvas.Top="8" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="爱情：" Canvas.Top="43" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="事业：" Canvas.Top="78" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="财富：" Canvas.Top="112" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <local:Star x:Name="s2_2" mark="5" Canvas.Left="68" Canvas.Top="45" d:LayoutOverrides="Width, Height, Margin" />
                                        <local:Star x:Name="s2_3" mark="4" Canvas.Left="68" Canvas.Top="80" d:LayoutOverrides="Width, Height, Margin" />
                                        <local:Star x:Name="s2_4" mark="2" Canvas.Left="68" Canvas.Top="112" d:LayoutOverrides="Width, Height, Margin" />
                                    </Canvas>
                                </Canvas>
                            </Canvas>
                            <Canvas Margin="2,0,-2,199" Height="45" VerticalAlignment="Bottom">
                                <Button Content="本周运程" Click="BtnLuck" Height="40" Style="{StaticResource ButtonStyle1}" Width="456"/>
                                <Canvas Height="139" Canvas.Top="42" Width="456">
                                    <Canvas Height="148" Canvas.Left="8" Width="193">
                                        <local:Star x:Name="s3_1" mark="5" Canvas.Left="68" Canvas.Top="9" d:LayoutOverrides="Width, Height, Margin" />
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="整体：" Canvas.Top="8" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="爱情：" Canvas.Top="43" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="事业：" Canvas.Top="78" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <TextBlock Canvas.Left="8" TextWrapping="Wrap" Text="财富：" Canvas.Top="112" Foreground="#FF1D1D1D" FontSize="18"/>
                                        <local:Star x:Name="s3_2" mark="5" Canvas.Left="68" Canvas.Top="45" d:LayoutOverrides="Width, Height, Margin" />
                                        <local:Star x:Name="s3_3" mark="4" Canvas.Left="68" Canvas.Top="80" d:LayoutOverrides="Width, Height, Margin" />
                                        <local:Star x:Name="s3_4" mark="2" Canvas.Left="68" Canvas.Top="112" d:LayoutOverrides="Width, Height, Margin" />
                                    </Canvas>
                                </Canvas>
                            </Canvas>
                        </Grid>
                    </ScrollViewer>
                </Canvas>
            </controls:PivotItem>

            <!--枢轴项二-->
            <controls:PivotItem Header="档案" Margin="12,24,12,4">
                <Grid>
                    <Canvas Margin="0,0,0,206">
                        <TextBlock x:Name="doc1" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="19" Foreground="#FF1D1D1D" FontSize="18" Width="307"/>
                        <TextBlock x:Name="doc2" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="54" Foreground="#FF1D1D1D" FontSize="18" RenderTransformOrigin="0.014,0.667" Height="27" Width="307"/>
                        <TextBlock x:Name="doc3" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="88" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc4" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="122" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc5" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="156" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc6" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="192" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc7" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="225" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc8" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="259" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc9" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="292" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc10" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="325" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                        <TextBlock x:Name="doc11" Canvas.Left="23" TextWrapping="Wrap" Canvas.Top="357" Foreground="#FF1D1D1D" FontSize="18" Height="27" Width="307"/>
                    </Canvas>
                    <Button x:Name="BtnLove" Click="DocBtn" Content="" HorizontalAlignment="Left" Height="37" Margin="22,0,0,153" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="178"/>
                    <Button x:Name="BtnLegend" Click="DocBtn" Content="" HorizontalAlignment="Right" Height="37" Margin="0,0,24,153" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="178"/>
                    <Button x:Name="BtnBoy" Click="DocBtn" Content="" HorizontalAlignment="Left" Height="37" Margin="22,0,0,87" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="178"/>
                    <Button x:Name="BtnGirl" Click="DocBtn" Content="" HorizontalAlignment="Right" Height="37" Margin="0,0,24,87" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="178"/>
                    <Button x:Name="BtnOrigin" Click="DocBtn" Content="" HorizontalAlignment="Left" Height="37" Margin="22,0,0,20" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="178"/>
                    <Button x:Name="BtnCharacter" Click="DocBtn" Content="" HorizontalAlignment="Right" Height="37" Margin="0,0,24,20" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="178"/>
                </Grid>
            </controls:PivotItem>
            <controls:PivotItem Header="速配">
                <ScrollViewer>
                    <Grid Height="1200" Width="456">
                        <Button Content="白羊座" CommandParameter="0" Tag="/Images/icon2_03.png" Click="BtnPair" HorizontalAlignment="Left" Height="156" Margin="24,19,0,0" Style="{StaticResource ButtonStyle3}" VerticalAlignment="Top" Width="156"/>
                        <Button Content="金牛座" CommandParameter="1" Tag="/Images/icon2_04.png" Click="BtnPair" Height="156" Margin="220,19,80,0" Style="{StaticResource ButtonStyle3}" VerticalAlignment="Top"/>
                        <Button Content="双子座" CommandParameter="2" Tag="/Images/icon2_05.png" Click="BtnPair" HorizontalAlignment="Left" Margin="24,201,0,0" Style="{StaticResource ButtonStyle3}" Width="156" Height="156" VerticalAlignment="Top"/>
                        <Button Content="巨蟹座" CommandParameter="3" Tag="/Images/icon2_06.png" Click="BtnPair" Margin="220,201,80,0" Style="{StaticResource ButtonStyle3}" Height="156" VerticalAlignment="Top" d:LayoutOverrides="Height"/>
                        <Button Content="狮子座" CommandParameter="4" Tag="/Images/icon2_07.png" Click="BtnPair" HorizontalAlignment="Left" Margin="24,382,0,0" Style="{StaticResource ButtonStyle3}" Width="156" Height="156" VerticalAlignment="Top" d:LayoutOverrides="Height"/>
                        <Button Content="处女座" CommandParameter="5" Tag="/Images/icon2_08.png" Click="BtnPair" Margin="220,382,80,0" Style="{StaticResource ButtonStyle3}" Height="156" VerticalAlignment="Top" d:LayoutOverrides="Height"/>
                        <Button Content="天秤座" CommandParameter="6" Tag="/Images/icon2_09.png" Click="BtnPair" HorizontalAlignment="Left" Margin="24,0,0,478" Style="{StaticResource ButtonStyle3}" Width="156" Height="156" VerticalAlignment="Bottom"/>
                        <Button Content="天蝎座" CommandParameter="7" Tag="/Images/icon2_10.png" Click="BtnPair" Margin="220,0,80,478" Style="{StaticResource ButtonStyle3}" Height="156" VerticalAlignment="Bottom"/>
                        <Button Content="射手座" CommandParameter="8" Tag="/Images/icon2_11.png" Click="BtnPair" HorizontalAlignment="Left" Margin="24,0,0,297" Style="{StaticResource ButtonStyle3}" Width="156" Height="156" VerticalAlignment="Bottom" d:LayoutOverrides="Height"/>
                        <Button Content="魔蝎座" CommandParameter="9" Tag="/Images/icon2_12.png" Click="BtnPair" Margin="220,0,80,297" Style="{StaticResource ButtonStyle3}" Height="156" VerticalAlignment="Bottom" d:LayoutOverrides="Height"/>
                        <Button Content="水瓶座" CommandParameter="10" Tag="/Images/icon2_01.png" Click="BtnPair" HorizontalAlignment="Left" Margin="24,0,0,103" Style="{StaticResource ButtonStyle3}" Width="156" Height="156" VerticalAlignment="Bottom" d:LayoutOverrides="Height"/>
                        <Button Content="双鱼座" CommandParameter="11" Tag="/Images/icon2_02.png" Click="BtnPair" Margin="220,0,80,103" Style="{StaticResource ButtonStyle3}" Height="156" VerticalAlignment="Bottom" d:LayoutOverrides="Height"/>
                    </Grid>
                </ScrollViewer>
            </controls:PivotItem>
            <controls:PivotItem Header="名人" Margin="30,28,25,0">
                <Grid>
                    <ListBox Tap="list_Tap" Name="list" ItemsSource="{Binding}" 
                             ItemsPanel="{StaticResource ItemsPanelTemplate1}" 
                             ItemTemplate="{StaticResource DataTemplate2}"/>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <local:MyPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" BackgroundColor="#7f49d1" ForegroundColor="{StaticResource PhoneInverseBackgroundColor}">
            <shell:ApplicationBarIconButton IconUri="/Images/i_home.png" Text="主页" Click="Click_Home" />
            <shell:ApplicationBarIconButton x:Name="Bar_Collect" Click="Click_Collect" IconUri="/Images/i_add_aton.png" Text="关注" />
            <shell:ApplicationBarIconButton IconUri="/Images/i_set.png" Click="Click_Setting" Text="设置" />
            <shell:ApplicationBarIconButton IconUri="/Images/i_new.png" Click="Click_News"  Text="星闻" />
        </shell:ApplicationBar>
    </local:MyPage.ApplicationBar>

</local:MyPage>